#ifndef __USART_H
#define __USART_H
#include "stdio.h"	
#include "sys.h" 

#define USART1_DMA_TX_LENGTH   		256
#define USART1_DMA_RX_LENGTH   		256

#define USART2_DMA_TX_LENGTH   		256
#define USART2_DMA_RX_LENGTH   		256

#define USART3_DMA_TX_LENGTH   		128
#define USART3_DMA_RX_LENGTH   		128

extern uint16_t USART1_RX_STA;
extern uint16_t MQTT_count;

extern unsigned char USART1_TX_BUF[USART1_DMA_TX_LENGTH];
extern unsigned char USART1_RX_BUF[USART1_DMA_RX_LENGTH];

extern unsigned char USART3_TX_BUF[USART3_DMA_TX_LENGTH];
extern unsigned char USART3_RX_BUF[USART3_DMA_RX_LENGTH];

void usart1_init(uint32_t bound);
void send_data_dma_u1(uint8_t data[100],uint8_t num);
void u1_printf(char* fmt,...);

void usart2_init(uint32_t bound);
void send_data_dma_u2(uint8_t data[100],uint8_t num);
void u2_printf(char* fmt,...);

void usart3_init(uint32_t bound);
void send_data_dma_u3(uint8_t data[100],uint8_t num);
void u3_printf(char* fmt,...);
#endif


